package com.ninetaildemonfox.zdl.socialproject.mvp.ui.adapter;

import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ninetaildemonfox.zdl.socialproject.R;
import com.ninetaildemonfox.zdl.socialproject.config.Constants;

import java.util.Map;

/**
 * 创建人： Nine tails fox
 * 创建时间： 2019/7/23
 * 功能描述：
 * 联系方式：1037438704@qq.com
 *
 * @author NineTailDemonFox
 */

public class SystemNewsAdapter extends BaseQuickAdapter<Map<String, String>, BaseViewHolder> {

    public SystemNewsAdapter(int item_order_reminding) {
        super(item_order_reminding);
    }

    @Override
    protected void convert(BaseViewHolder helper, Map<String, String> item) {
//        String time = null;
//        if (!TextUtils.isEmpty(item.get("text_tiem"))) {
//            time = Constants.stampDate(Integer.valueOf(item.get("text_tiem")) * 1000);
//
//        }
        helper.setText(R.id.text_tiem, item.get("create_time"));

        ImageView image_gone = helper.itemView.findViewById(R.id.image_gone);
        // 是否读取 1否2是
        String is_read = item.get("is_read");
        if (is_read.equals("1")) {
            image_gone.setVisibility(View.VISIBLE);
        } else {
            image_gone.setVisibility(View.GONE);
        }
        helper.setText(R.id.text_title, item.get("msg_title"))
                .setText(R.id.text_context, item.get("msg_content"));

    }
}
